//引入element-plus提供全部图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

//全局svg组件的定义
import phone from './index.vue'

const allGloableComponent:any = {phone}
export default {
    install(app:any){
        //循环注册
        (Object.keys(allGloableComponent) as Array<keyof typeof allGloableComponent>).forEach(key => {
            app.component(key, allGloableComponent[key]);
        });
        //将element-plus提供图标注册为全局组件（解构为组件的名字，和组件值，再进行for循环注册）
        for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
            app.component(key, component)
          }
    }
}